package com.zy.algorithm.v3

import com.zy.activity.BaseMenuActivity
import com.zy.activity.bean.BaseMenuBean
import android.content.Intent
import com.zy.algorithm.v3.complexity.ComplexityFragment
import java.util.ArrayList

internal class AlgorithmComplexityActivity : BaseMenuActivity() {
    override fun init(list: ArrayList<BaseMenuBean>) {
        list.add(BaseMenuBean("算法复杂度"))
        list.add(BaseMenuBean("O(n)O(1)", ComplexityFragment::class.java, 0))
        list.add(BaseMenuBean("O(n)O(n)", ComplexityFragment::class.java, 1))
        list.add(BaseMenuBean("O(n+m)O(1)", ComplexityFragment::class.java, 2))
        list.add(BaseMenuBean("O(n^2)O(1)", ComplexityFragment::class.java, 3))
        list.add(BaseMenuBean("O(kn)O(k)", ComplexityFragment::class.java, 4))
        list.add(BaseMenuBean("O(kn)O(1)", ComplexityFragment::class.java, 5))
        list.add(BaseMenuBean("O(n)O(k)", ComplexityFragment::class.java, 6))

    }

    override fun clickItem(bean: BaseMenuBean) {
        val intent = Intent(this, AlgorithmV3MainActivity::class.java)
        intent.putExtra("code", bean.code)
        intent.putExtra("targetClass", bean.targetClass)
        startActivity(intent)
    }
}